<style>
.ui-combobox {
      position: relative;
      display: inline-block;
      margin-bottom: 10px;
}
.ui-button-icon-only {
      position: absolute;
      top: 0;
      bottom: 0;
      margin-left: -1px;
      padding: 0;
      /* adjust styles for IE 6/7 */
      *height: 1.7em;
      *top: 0.1em;
}
.ui-autocomplete-input {
      margin: 0;
      padding: 0.3em;
}
</style>
      <div class="adminrectangle"><h2><?php echo $title;?></h2></div>
      <div class="grid_12">
            <h5><?php echo lang('edit_stage');?></h5>
      </div>
	<div class='clear'></div>
  <?php if(isset($message))
  {
  ?>
  <div id="infoMessage"><?php echo $message;?></div>
  <?php
  }
  ?>
      <?php if ($this->session->flashdata('message')) { ?>
      <div class="infoMessage"><?php echo $this->session->flashdata('message');?></div>
      <?php } ?>
      <?php
      if(isset($help_message_text))
      {
        if($help_message_text !="")
        {
      ?>
          <div id="helpMessage" title="<?php echo lang($help_message_title);?>"><?php echo lang($help_message_text);?></div>
      <?php
        }
      }
      ?>  
	<div class="grid_4 alpha">
        <?php
        $previous = $stage_id['value'] - 1;
        $next = $stage_id['value'] + 1;
        if ($previous >= 0)
        {
            echo anchor('admin/edit_stage/'.$previous, "<span class='icon icon101'></span><span class='label'>".lang('stage')." ".$previous."</span>", "class='button'");
        }
        if ($next <= 20)
        {    
            echo anchor('admin/edit_stage/'.$next, "<span class='icon icon102'></span><span class='label'>".lang('stage')." ".$next."</span>", "class='button'");
        }
        ?>   
      </div>
      <div class='clear'></div>
      <div class="grid_12 alpha omega">
        <div class="grid_4 alpha">
          <?php echo form_open("admin/edit_stage/".$stage_id['value'], "name='formname'");?>
      
            <div class='label'><?php echo lang('stage_number');?>:</div>
            <div class='clear'></div>
            <div><?php echo form_input($stage_id);?></div>
            <div class='clear'></div>

            <div class='label'><?php echo lang('stage_type');?>:</div>
            <div class='clear'></div>
            <div><?php echo form_dropdown('stage_type', $stage_type_options, $stage_type['value'], "class='ui-widget combobox'");?></div>
            <div class='clear'></div>
            
            <div class='label'><?php echo lang('stage_date');?>:</div>
            <div class='clear'></div>
            <div><?php echo form_input($stage_date);?></div>
            <div class='clear'></div>
            
            <div class='label'><?php echo lang('stage_depart');?>:</div>
            <div class='clear'></div>
            <div><?php echo form_input($stage_depart);?></div>
            <div class='clear'></div>
            
            <div class='label'><?php echo lang('stage_arrive');?>:</div>
            <div class='clear'></div>
            <div><?php echo form_input($stage_arrive);?></div>
            <div class='clear'></div>
            
            <div class='label'><?php echo lang('distance');?>:</div>
            <div class='clear'></div>
            <div><?php echo form_input($stage_distance);?></div>
            <div class='clear'></div>

		<div class='buttons'>
              <button type="submit" class="button positive"><span class="icon icon6"></span><span class='label'><?php echo lang('save');?></span></button>
      	  <?php echo anchor("admin/stages","<span class='icon icon7'></span><span class='label'>".lang('cancel')."</span>","class='button'");?>
            </div>
            <?php echo form_close();?>
        </div>
        <div class="grid_8 omega">
            <?php if ($stage_id['value'] == '0') { $img_id = 0; } else { $img_id = $stage_id['value'].'00'; } ?>
            <img src="http://www.letour.fr/PHOTOS/TDF/2012/<?php echo $img_id;?>/CARTE.jpg" />
        </div>        
      </div>
      <script src="<?php echo base_url();?>assets/admin/js/jquery.ui.combobox.js"></script>
      <script>
      $(function() {
            $( ".combobox" ).combobox();
            // datepicker
            $( ".datepicker" ).datepicker({ dateFormat: "yy-mm-dd" });
            });
      </script>      
